package cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.controller;

import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.entity.EmployeeAssInstruction;
import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.service.EmployeeAssInstructionService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 张烁瑜
 * @Date 2025/5/27 21:31
 */
@RestController
@RequestMapping("/employeeAssInstruction")
public class EmployeeAssInstructionController {
    @Autowired
    private EmployeeAssInstructionService employeeAssInstructionService;

    @PostMapping
    public String save(@RequestBody EmployeeAssInstruction employeeAssInstruction) {
        return employeeAssInstructionService.save(employeeAssInstruction);
    }

    @PutMapping
    public String update(@RequestBody EmployeeAssInstruction employeeAssInstruction) {
        return employeeAssInstructionService.update(employeeAssInstruction);
    }

    @DeleteMapping("/{employeeAssInstructionId}")
    public String delete(@PathVariable Long employeeAssInstructionId) {
        return employeeAssInstructionService.delete(employeeAssInstructionId);
    }

    @GetMapping
    public PageInfo<EmployeeAssInstruction> get(int pageNum, int pageSize, EmployeeAssInstruction employeeAssInstruction) {
        return employeeAssInstructionService.get(pageNum,pageSize,employeeAssInstruction);
    }
}
